﻿using Modules.Template;
using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules
{
    /// <summary>
    /// 模板表
    ///</summary>
    [TableName("sys_template")]
    [Description("模板表")]
    [PrimaryKey("id", AutoIncrement = true)]
    [CacheSetting(true)]
    [Serializable]
    public class SysTemplate : IEntity
    {
        /// <summary>
        /// 主键
        ///</summary>
        [Column("id")]
        public string Id { get; set; }

        /// <summary>
        /// 模板类型
        ///</summary>
        [Column("type")]
        public 模板类型 Type { get; set; }

        /// <summary>
        /// 模板名称
        ///</summary>
        [Column("name")]
        public string Name { get; set; }

        /// <summary>
        /// 桶名称
        ///</summary>
        [Column("bucket_name")]
        public string BucketName { get; set; }

        /// <summary>
        /// 对象名称
        ///</summary>
        [Column("object_file_path")]
        public string ObjectFilePath { get; set; }

        /// <summary>
        /// 友好的名称
        ///</summary>
        [Column("friendly_name")]
        public string FriendlyName { get; set; }

        /// <summary>
        /// 媒体类型
        ///</summary>
        [Column("media_type")]
        public byte? MediaType { get; set; }

        /// <summary>
        /// 附件MIME类型
        ///</summary>
        [Column("content_type")]
        public string ContentType { get; set; }

        /// <summary>
        /// 附件描述
        ///</summary>
        [Column("discription")]
        public string? Discription { get; set; }

        /// <summary>
        /// 是否删除
        ///</summary>
        [Column("is_deleted")]
        public bool? IsDeleted { get; set; }

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return this.Id; } }

        #endregion IEntity 成员
    }
}